package com.wdciti.sccp.iot.utils;

import com.wdciti.sccp.iot.springvertx.annotation.VerticleBean;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonObject;

/**
 * @author by early
 */
//@Slf4j
//@VerticleBean(isWorker = true)
public class testTcpMsgVerticle extends AbstractVerticle {

    @Override
    public void start() {
        vertx.eventBus().<Buffer>consumer("ely://myd/in").handler(msg -> {
            System.out.println(msg.body().toString());
            vertx.eventBus().send("ely://myd/out",
                    new JsonObject().put(msg.body().toString(), "hello!").toBuffer());
        });
    }

}
